include etc/dotgleerc

X = glee1
Uses = $(Gawk) -f $(Glee)/uses.awk Dir=$(Lib)  $(Lib)/$(X).awk
Libs = $(shell $(Uses))
Awks = $(subst $(Lib),$(Awk),$(Libs))
DashF= -f $(subst  .awk ,.awk -f ,$(Awks))
Run  = $(Gawk) $(DashF)

#-----------------------------------------------
Profile=$(Tmp)/prof.out
Vars =$(Tmp)/vars.out
Spy  = $(Pgawk) --profile=$(Profile) --dump-variables=$(Vars)  $(DashF)
Dump = if cat $(Vars) | egrep -v '^[A-Z]+:' ; then true; else true; fi;

#----------------------------------------------
I    = printf "\n---| $(X) |----------------------------\n\n"
a    = $(Run)  --source 'BEGIN {#
z    = ; exit;}'
A    = $(Spy)  --source 'BEGIN {#
Z    = ; exit;}'

#----------------------------------------------
all : installDirs compileFiles svns

installDirs :
	@mkdir -p $(Dirs)

compileFiles: 
	$(Gawk) -f $(Glee)/glee.awk $(Awks)

svns :
	@svn propset svn:ignore var/awk  . > /dev/null
	@svn propset svn:ignore var/html . > /dev/null

run : all
	@$A $(Do) $Z

$(Awk)/%.awk : $(Lib)/%.awk
	@cat $< \
	| gawk -f $(Glee)/comment.awk \
	| gawk -f $(Glee)/glee.awk  > $@

#----------------------------------------------
include lib/egs

